﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Home/Layouts/Home.Master" AutoEventWireup="true"
    CodeBehind="Checkout.aspx.cs" Inherits="MLM.Home.Pages.Checkout" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        #Checkout_ShippingDetail
        {
        }
        #Checkout_ShippingDetail td
        {
            padding: 3px;
        }
        #Checkout_ShippingDetail input[type=text], select
        {
            padding: 2px;
            border: solid 1px #ccc;
            width: 200px;
        }
        .CheckOutNow
        {
            background: none repeat scroll 0 0 #464646;
            border: 3px double #FFFFFF;
            color: #FFFFFF;
            padding: 2px;
            text-decoration: none;
        }
        .CheckOutNow:hover
        {
            background: #333;
            cursor: pointer;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager runat="server">
    </asp:ScriptManager>
    <h3 class="main_title">
        Check out
    </h3>
    <div class="CartView">
        <asp:GridView runat="server" ID="gvShoppingCart" AutoGenerateColumns="False" EmptyDataText="Shopping cart empty product"
            Width="100%" CellPadding="4" ShowFooter="True" DataKeyNames="ProductId" OnRowDataBound="gvShoppingCart_RowDataBound"
            OnRowCommand="gvShoppingCart_RowCommand" BackColor="White" BorderColor="#8D8155"
            BorderStyle="None" BorderWidth="1px" ForeColor="Black" GridLines="Vertical">
            <HeaderStyle HorizontalAlign="Left" BackColor="#E9EAEF" ForeColor="Black" Font-Bold="True"
                Height="40px" />
            <FooterStyle HorizontalAlign="Right" BackColor="#CCCC99" />
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:TemplateField HeaderText="STT">
                    <ItemTemplate>
                        <div style="padding: 5px;">
                            <%# Container.DataItemIndex + 1 %>
                        </div>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Name" HeaderText="Product Name" />
                <asp:TemplateField HeaderText="Count">
                    <ItemTemplate>
                        <asp:TextBox runat="server" ID="txtQuantity" Columns="5" Text='<%# Eval("Quantity") %>'></asp:TextBox><br />
                        <asp:LinkButton runat="server" ID="btnRemove" Text="Remove" CommandName="Remove"
                            CommandArgument='<%# Eval("ProductId") %>' Style="font-size: 12px;"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="UnitPrice" HeaderText="Price">
                    <HeaderStyle HorizontalAlign="Right" />
                    <ItemStyle HorizontalAlign="Right" />
                </asp:BoundField>
                <asp:BoundField DataField="TotalPrice" HeaderText="Total Price">
                    <HeaderStyle HorizontalAlign="Right" />
                    <ItemStyle HorizontalAlign="Right" />
                </asp:BoundField>
            </Columns>
            <RowStyle BackColor="#F7F7DE" />
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
            <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
        </asp:GridView>
        <br />
        <asp:Button runat="server" ID="btnUpdateCart" Text="Update to cart" OnClick="btnUpdateCart_Click"
            CssClass="CheckOutNow" />
    </div>
    <div class="main_content">
        <h4>
            Shipping Information</h4>
        <table id="Checkout_ShippingDetail">
            <tr>
                <td>
                    Gender:
                </td>
                <td>
                    <asp:DropDownList runat="server" ID="GenderDDL">
                        <Items>
                            <asp:ListItem runat="server" Value="1">Male</asp:ListItem>
                            <asp:ListItem runat="server" Value="0">Female</asp:ListItem>
                        </Items>
                    </asp:DropDownList>
                </td>
                <td>
                    Date Of Birth:
                </td>
                <td>
                    <telerik:RadDatePicker runat="server" ID="DateOfBirthPk">
                    </telerik:RadDatePicker>
                </td>
            </tr>
            <tr>
                <td>
                    First Name:
                </td>
                <td>
                    <asp:TextBox runat="server" ID="FirstNameTxt"></asp:TextBox>
                </td>
                <td>
                    Last Name:
                </td>
                <td>
                    <asp:TextBox runat="server" ID="LastNameTxt"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Country:
                </td>
                <td>
                    <asp:DropDownList ID="CountryDDL" runat="server" DataSourceID="GroupCountryEds" DataValueField="CountryID"
                        DataTextField="Name" AutoPostBack="true">
                    </asp:DropDownList>
                    <asp:EntityDataSource ID="GroupCountryEds" runat="server" ConnectionString="name=MLMDataContext"
                        DefaultContainerName="MLMDataContext" EnableFlattening="False" EntitySetName="Countries"
                        EntityTypeFilter="Country" OrderBy="it.Name">
                    </asp:EntityDataSource>
                </td>
                <td>
                    City:
                </td>
                <td>
                    <asp:DropDownList ID="CityDDL" runat="server" DataSourceID="CitiesEds" DataTextField="Name"
                        DataValueField="CityID">
                    </asp:DropDownList>
                    <asp:EntityDataSource ID="CitiesEds" runat="server" ConnectionString="name=MLMDataContext"
                        DefaultContainerName="MLMDataContext" EnableFlattening="False" EntitySetName="Cities"
                        EntityTypeFilter="City" OrderBy="it.Name" AutoGenerateWhereClause="true">
                        <WhereParameters>
                            <asp:ControlParameter runat="server" ControlID="CountryDDL" PropertyName="SelectedValue"
                                Name="CountryID" Type="Int64" />
                        </WhereParameters>
                    </asp:EntityDataSource>
                </td>
            </tr>
            <tr>
                <td>
                    Address:
                </td>
                <td>
                    <asp:TextBox ID="AddressTxt" runat="server"></asp:TextBox>
                </td>
                <td>
                    Postal/Zip code:
                </td>
                <td>
                    <asp:TextBox ID="PostalCodeTxt" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Email:
                </td>
                <td>
                    <asp:TextBox ID="EmailTxt" runat="server"></asp:TextBox>
                </td>
                <td>
                    Phone number:
                </td>
                <td>
                    <asp:TextBox ID="PhoneNumberTxt" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <i>* All field are required!</i>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <asp:Label runat="server" ID="MessageLbl"></asp:Label>
                </td>
            </tr>
            <tr>
                <td colspan="3" style="text-align: center;">
                    <asp:Button Text="Check out" ID="CheckoutBtn" runat="server" CssClass="CheckOutNow" />
                </td>
                <td>
                    <asp:Button ID="btnPaymentPP" runat="server" Visible="true" Text="Cart Out" CssClass="CheckOutNow" />
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
